package com.ruoyi.utils;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * 通用分页响应类
 *
 * @author 周志雄
 * @date 2024-03-09
 */
@Data
public class PageResult<T> {
    @ApiModelProperty(value = "当前页码")
    private int pageNum;
    @ApiModelProperty(value = "页面大小")
    private int pageSize;
    @ApiModelProperty(value = "总记录数")
    private int totalSize;
    @ApiModelProperty(value = "总页数")
    private int totalPages;
    @ApiModelProperty(value = "当前页数据")
    private List<T> data;

    public PageResult(int totalSize, int totalPages, List<T> data, int pageNum, int pageSize) {
        this.totalSize = totalSize;
        this.totalPages = totalPages;
        this.data = data;
        this.pageNum = pageNum;
        this.pageSize = pageSize;
    }
}

